home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form MainForm
- HelpContextID = 1
- BackColor = &H00C0C0C0&
- Caption = "Form Wizard"
- ClientHeight = 600
- ClientLeft = 6315
- ClientTop = 6015
- ClientWidth = 2865
- ControlBox = 0 'False
- Height = 1005
- Icon = MAINFORM.FRX:0000
- Left = 6255
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 600
- ScaleWidth = 2865
- Top = 5670
- Width = 2985
- Begin SSCommand BtnHelp
- Caption = "&Help"
- Font3D = 2 'Raised w/heavy shading
- Height = 615
- Left = 1920
- Picture = MAINFORM.FRX:0302
- TabIndex = 2
- Top = 0
- Width = 975
- Begin SSCommand BtnExit
- Caption = "E&xit"
- Font3D = 2 'Raised w/heavy shading
- Height = 615
- Left = 960
- Picture = MAINFORM.FRX:0604
- TabIndex = 1
- Top = 0
- Width = 975
- Begin SSCommand BtnNewForm
- Caption = "&New Form"
- Font3D = 2 'Raised w/heavy shading
- Height = 615
- Left = 0
- Picture = MAINFORM.FRX:0906
- TabIndex = 0
- Top = 0
- Width = 975
- Option Explicit
- Sub BtnExit_Click ()
- Dim AppName$, KeyName$, NewVal$, IniFileName$
- On Error GoTo ExitErr
- EndItNow
- ' Same last position of mainform for next time
- IniFileName$ = "FRMWIZRD.INI" 'name of ini file
- AppName$ = "Form Wizard" 'Name of application or section heading
- KeyName$ = "Left" 'Keyword or variable name
- NewVal$ = Trim$(Str$(MainForm.Left)) 'Left pos
- SaveIni AppName$, IniFileName$, KeyName$, NewVal$
- KeyName$ = "Top" 'Keyword or variable name
- NewVal$ = Trim$(Str$(MainForm.Top)) 'Top pos
- SaveIni AppName$, IniFileName$, KeyName$, NewVal$
- Cancel3D ' Cancel the 3-D common dialogs
- End
- ExitErr:
- erraction = RB_ErrorHandler("MainForm", "BtnExit_Click")
- Select Case erraction
- Case 1
- Resume 0 ' Retry option selected
- Case 2
- Resume Next ' Ignore option selected
- End Select
- End Sub
- Sub BtnHelp_Click ()
- ' TestForm.Show MODELESS
- SendKeys "{F1}"
- End Sub
- Sub BtnNewForm_Click ()
- EndingIt = False
- RequiredFieldsComplete = "NNNN" ' Indicate Required Fields not present
- DataForm.Show MODELESS
- MainForm.Hide
- End Sub
- Sub Form_Load ()
- Dim AppName$, KeyName$, nDefault, Numeric%, DefaultStr$
- Dim IniFileName$, nSize%
- Dim ReturnStr As String 'Create an empty string to be filled
- Dim LastLeft As Long, LastTop As Long
- On Error GoTo Loaderr
- rb_systemname = "RDB Form Wizard"
- rb_version = "1.0"
- quote = """"
- Rem start the 3D dialogs
- Inst% = GetModuleHandle(App.EXEName) ' Get program's ModuleHandle.
- ret = Ctl3dRegister(Inst%) ' Register program w/ Ctl3d.
- ret = Ctl3dAutoSubclass(Inst%) ' Subclass the program.
- NewRecordSource = False
- EndingIt = False
- ' Check INI file to get last position
- IniFileName$ = "FRMWIZRD.INI" 'name of ini file
- AppName$ = "Form Wizard" 'Name of application or section heading
- KeyName$ = "Left" 'Keyword or variable name
- nDefault = 0 'Default numeric value (for numeric variables)
- DefaultStr$ = "0" 'Default string (for String variables)
- nSize% = 255 'uncertain - possibly length of fill string
- Numeric% = False 'Tell it we are looking for a string
- ReadIni AppName$, KeyName$, nDefault, DefaultStr$, ReturnStr, Numeric%, IniFileName$
- LastLeft = Val(ReturnStr)
- KeyName$ = "Top" 'Keyword or variable name
- nDefault = 0 'Default numeric value (for numeric variables)
- DefaultStr$ = "0" 'Default string (for String variables)
- ReturnStr = ""
- nSize% = 255 'uncertain - possibly length of fill string
- Numeric% = False
- ReadIni AppName$, KeyName$, nDefault, DefaultStr$, ReturnStr, Numeric%, IniFileName$
- LastTop = Val(ReturnStr)
- If LastLeft > 0 And LastTop > 0 Then
- MainForm.Left = LastLeft
- MainForm.Top = LastTop
- End If
- Exit Sub
- Loaderr:
- erraction = RB_ErrorHandler("MainForm", "Form_Load")
- Select Case erraction
- Case 1
- Resume 0 ' Retry option selected
- Case 2
- Resume Next ' Ignore option selected
- End Select
- End Sub
-